package dbz.domain;

public class Health {

	private Integer maxHitPoints;
	private Integer damageHitPoints;

	public Health(Integer maxHitPoints) {
		this.maxHitPoints = maxHitPoints;
		this.damageHitPoints = 0;
	}

	public void takeDamage(Integer damage) {
		damageHitPoints += damage;

	}

	public Integer getRemainingHitPoints() {
		return maxHitPoints - damageHitPoints >= 0 ? maxHitPoints - damageHitPoints : 0;
	}

	public Boolean isFullDamage() {
		return getRemainingHitPoints() == 0;
	}

	public void recover(Integer hitPoints) {
		if(damageHitPoints - hitPoints >= 0)
			damageHitPoints -= hitPoints;
		else
			damageHitPoints = 0;
	}

	public void increaseMaxHitPoints(Integer hitPoints) {
		maxHitPoints += hitPoints;
		
	}
	
	public Integer getMaxHitPoints() {
		return maxHitPoints;
	}

	public void setMaxHitPoints(Integer maxHitPoints) {
		this.maxHitPoints = maxHitPoints;
	}

	public Integer getDamageHitPoints() {
		return damageHitPoints;
	}

	public void setDamageHitPoints(Integer damageHitPoints) {
		this.damageHitPoints = damageHitPoints;
	}

	

}
